#include<iostream>
#include<malloc.h>
using namespace std;
struct Tree
{
	char key;
	Tree *p;
	Tree *leftchild;
	Tree *rightchild;
	Tree *Parent;
}; 
Tree *nil;
void CreateTree(Tree*nil)
{
	char c;
	while(cin>>c)
	{
	if(' '==c)
	{
		nil=NULL;
	}
	else 
	{
		nil=(Tree*)malloc(sizeof(Tree));
		nil->key=c;
	}
	CreateTree(nil->leftchild);
	CreateTree(nil->rightchild);
	}
}
void PrintTree(Tree*p)
{
	if(p==NULL)
	return;
	PrintTree(p->leftchild);
	PrintTree(p->rightchild);
 } 
int main()
{
	CreateTree(nil);
 } 
